package yazan.com.pdacollector_android.adapter;

import android.support.annotation.Nullable;

import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseItemDraggableAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.Date;
import java.util.List;

import yazan.com.pdacollector_android.R;
import yazan.com.pdacollector_android.model.Goods;

public class OrderValidationAdapter extends BaseItemDraggableAdapter<Goods, BaseViewHolder> {
    public OrderValidationAdapter(int layoutResId, @Nullable List<Goods> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Goods item) {
        helper.setGone(R.id.tvIndex, false);
        helper.setText(R.id.tvGoodName, item.getFgoods_name());
        helper.setText(R.id.tvBarcode, item.getFgoods_sn());
        helper.setText(R.id.tvSpecification, item.getFgoods_spec());
        helper.setText(R.id.tvCount, "1");
        helper.setText(R.id.tvTime, TimeUtils.date2String(new Date()));
    }
}
